package org.lanzier.common.utils;

import org.codehaus.jackson.map.ObjectMapper;

/**
 * @author lansb
 * jackson utils
 */
public class JsonUtils {
	private static ObjectMapper mapper;  

	/**
	 *@param createNew
	 *@return
	 */
	public static synchronized ObjectMapper getMapperInstance(boolean createNew) {  
		       if (createNew) {  
		         return new ObjectMapper();  
		        } else if (mapper == null) {  
		             mapper = new ObjectMapper();  
		    }  
		      return mapper;  
		    }  

}
